XuiMenu





Kid 0 - XuiMenu
"Selection" callback from selecting a pulldown list item
v0 : XuiMenuBar item - 1 is leftmost item
v1 : XuiPullDown item - 0 is topmost item

XuiMenu grids display a list of categories and let a user browse the items in each category by selecting the category name and select any item in any of the categories presented.

When a category name like File, Edit, View, or Help is selected by a user action, a borderless window with an XuiPullDown grid drops down directly below the category name to display a number of items in that category.  The user can select any item by dragging the mouse down to the item and releasing it, or by clicking on the category name to expose the XuiPullDown list, then on any item in the list.

XuiMenu grids create and manage the XuiPullDown windows without program intervention.   When an item in an XuiPullDown list is selected, the XuiMenu grid generates a Selection message that reports the both category and the item in that category in v0, v1.

Categories are numbered from 1 and items from 0.  If a user selects the top item in the File category, the Selection callback message will contain v0 = 1 and v1 = 0.

The category names and item names are both specified in the TextArray property of the XuiMenu grid, with item names indented below their left justified category names.   For example, the following code segment sets up the XuiMenu example shown above.

DIM menu$[15] ' callback arguments
menu$[ 0] = "_File"
menu$[ 1] = " _Load" ' v0 = 1 : v1 = 0
menu$[ 2] = " _Save" ' v0 = 1 : v1 = 1
menu$[ 3] = " _Quit" ' v0 = 1 : v1 = 2
menu$[ 4] = "_Edit"
menu$[ 5] = " _Cut" ' v0 = 2 : v1 = 0
menu$[ 6] = " _Grab" ' v0 = 2 : v1 = 1
menu$[ 7] = " _Paste" ' v0 = 2 : v1 = 2
menu$[ 8] = "_View"
menu$[ 9] = " _First" ' v0 = 3 : v1 = 0
menu$[10] = " _Last" ' v0 = 3 : v1 = 1
menu$[11] = " _All" ' v0 = 3 : v1 = 2
menu$[12] = "_Help"
menu$[13] = " _Contents" ' v0 = 4 : v1 = 0
menu$[14] = " _Summary" ' v0 = 4 : v1 = 1
menu$[15] = " _Index" ' v0 = 4 : v1 = 2

XuiSendStringMessage (grid, @"SetTextArray", 0, 0, 0, 0, 0, @menu$[])